package com.bsj.travel.monitor.web.controller;

import com.bsj.travel.def.common.DTO.web.TimeDTO;
import com.bsj.travel.def.common.VO.device.DeviceTotalVO;
import com.bsj.travel.def.global.JsonResult;
import com.bsj.travel.monitor.service.MonitorService;
import com.bsj.travel.security.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;
import java.util.Map;

/***
 * @description MonitorController
 * @author LiJiaXin
 * @version 1.0.0
 * @time 2024/1/30 11:13
 **/
@RestController
@RequestMapping("/monitor")
public class MonitorController {

    @Autowired
    private MonitorService monitorService;

    /**
     * 实时监控
     *
     * @param timeDTO
     * @return com.bsj.travel.def.global.JsonResult<java.util.Map<java.lang.String,java.util.List<com.bsj.travel.def.common.VO.device.DeviceTotalVO>>>
     * @author ljx
     * @time 2024/1/30 11:41
     */
    @GetMapping("realTimeMonitor")
    @RequiresPermissions(value = "monitor:info:realTimeMonitor")
    public JsonResult<Map<String, List<DeviceTotalVO>>> realTimeMonitor(@Validated TimeDTO timeDTO) {
        return monitorService.realTimeMonitor(timeDTO);
    }

}
